package com.nanshututeng.controller;

import com.nanshututeng.Service.GetUserInfoService;
import com.nanshututeng.model.UserBean;
import com.nanshututeng.model.testBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * Created by Administrator on 2018-09-20.
 */
@RestController
public class GetusetInfoController {
    @Autowired
    private GetUserInfoService mservice;
    @RequestMapping(value = "GetuserInfo",method = RequestMethod.GET)
    public List<UserBean>getusetinfo(){
        Map<String,Object> param=new HashMap<String,Object>();
        param.put("phone","18009024880");
        List<UserBean> list=mservice.selectUser(param);
        return list;

    }


    @RequestMapping(value = "Regist",produces ={"application/json"} )
@ResponseBody
    public String testjson(@RequestBody UserBean bean){
        System.out.print(bean.getUsername()+"------"+bean.getHeadimgurl());
        return "111";
    }


    @RequestMapping(value = "get",method = RequestMethod.GET)
    public List<UserBean>get(){
        return mservice.select();
    }
@RequestMapping(value = "get1",method = RequestMethod.GET)
    public  List<testBean> getbean(){
        return mservice.test();
}
}
